k nearest neighbor python from scratch